<?php
require ('../include/init.inc.php');
$module_name = $module_desc = $module_sort = $module_url = $module_icon ='';
extract ( $_POST );

if (Common::isPost ()) {
	$card = Card::getCardBySim($sim);
	if (!$card) {
		$input_data = array ('card_no' => $sim, 
						'card_type' => $type,
						'phone'=>$phone,
						'operator'=>$operator,
						'channel'=>$channel,
						'dead_time'=>$dead_time);
		$module_id = Card::addCard ( $input_data );
		
		if ($module_id) {
			SysLog::addLog ( UserSession::getUserName(), 'ADD', 'Module' , $module_id, json_encode($input_data) );
			Common::exitWithSuccess ('添加成功','panel/sms.php');
		}
	}
}
Template::assign("_POST" ,$_POST);
Template::display('panel/sms_add.tpl' );
